import { Schema, Prop, SchemaFactory } from '@nestjs/mongoose';
import { Document, Types } from 'mongoose';
export type VideoDocument = Video & Document;

@Schema()
export class Video {
    @Prop({ required: true, type: Types.ObjectId, ref: 'User' })
    userid: Types.ObjectId;

    @Prop({ required: true })
    vodid: string

    @Prop({ required: true })
    title: string

    @Prop({ default:0 })
    like: number

    @Prop({ default:0 })
    dislike: number

    @Prop({ default:0 })
    comments: number

    @Prop({ default: new Date() })
    createtime: Date

    @Prop({ default: new Date() })
    updatetime: Date
}

export const VideoSchema = SchemaFactory.createForClass(Video);